package ooseminar.parking;

import java.util.List;

class VacancyRateFirstChooser implements ParkingLotsChooser {
  public ParkingLots chooseParkingLots(List<ParkingLots> parkingLotsList1) {
    ParkingLots chosenParkingLots = parkingLotsList1.get(0);
    for (ParkingLots parkingLots : parkingLotsList1) {
        if ((double) parkingLots.get(new ParkingLots.NonComericalBasedChooserRateContextAction<Double>() {

            public Double calculate(int size1, int idle) {
                return (double) idle / size1;
            }
        }) > chosenParkingLots.get(new ParkingLots.NonComericalBasedChooserRateContextAction<Double>() {

            public Double calculate(int size1, int idle) {
                return (double) idle / size1;
            }
        }))
            chosenParkingLots = parkingLots;
    }
    return chosenParkingLots;
}
}
